import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
};

export const redefinePage = (current, size, params) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/fenFaPage',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
};

export const getDetail = (id) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/submit',
    method: 'post',
    data: row
  })
};

export const getPersonnelList = (current, size, params) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/getPersonnelList',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
};

export const saveCaseRegister = (row) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/saveCaseRegister',
        method: 'post',
        data: row
    })
};

export const preAuditPage = (current, size, params) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/accept-preAudit',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
};
export const historyFlowList = (processInstanceId) => {
  return request({
    url: '/api/blade-flow/process/history-flow-list',
    method: 'get',
    params: {
      processInstanceId
    }
  })
};

export const acceptPage = (current, size, params) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/accept-page',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
};

export const sendCaseBaseInfo = (row) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/sendCaseBaseInfo',
        method: 'post',
        data: row
    })
};

export const getXmlCaseForm = (projectNo) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/getXmlCaseForm',
        method: 'get',
        params: {
            projectNo
        }
    })
};

export const acceptCaseNumberByMonth = (year) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/acceptCaseNumberByMonth',
        method: 'get',
        params: {
            year
        }
    })
};

export const todayApplyCaseNumberTopFive = () => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/todayApplyCaseNumberTopFive',
        method: 'get',
    })
};

export const acceptCaseNumberOverview = () => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/acceptCaseNumberOverview',
        method: 'get',
    })
};

export const caseFromCount = () => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/caseFromCount',
        method: 'get',
    })
};

export const savePhase = (row) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/savePhase',
    method: 'post',
    data: row
  })
};

export const getLicneseTypeNameData = (deptCode) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/getLicneseTypeNameData',
    method: 'get',
    params: {
      deptCode
    }
  })
};

export const getLicneseTypeNameJsonArray = (deptCode) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/getLicneseTypeNameJsonArray',
    method: 'get',
    params: {
      deptCode
    }
  })
};


export const getTaskExtend = (taskGuid, licenseTypeCode, licenseTypeName, catalogNo, catalogName,  extendType) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/getTaskExtend',
    method: 'post',
    params:{
      taskGuid,
      licenseTypeCode,
      licenseTypeName,
      catalogNo,
      catalogName,
      extendType
    }
  })
};

export const getTaskBase = (itemId, licenseTypeCode, licenseTypeName, catalogNo, catalogName,  extendType) => {
  return request({
    url: '/api/vingsoft-acceptance/caseInfo/getTaskBase',
    method: 'post',
    params:{
      itemId,
      licenseTypeCode,
      licenseTypeName,
      catalogNo,
      catalogName,
      extendType
    }
  })
};

export const pushCaseInfoToCaseCenter = (projectNo) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/pushCaseInfoToCaseCenter',
        method: 'get',
        params: {
            projectNo
        }
    })
};

export const manualCaseToYwsp = (id) => {
    return request({
        url: '/api/vingsoft-acceptance/caseInfo/manualCaseToYwsp',
        method: 'post',
        params: {
            id
        }
    })
};

export const proCaseInfoDetail = (projectNo) => {
  return request({
    url: '/api/vingsoft-ywsp/proCaseInfo/detail',
    method: 'get',
    params: {
      projectNo
    }
  })
};
export const getCaseInfoByProjectNo = (projectNo) => {
  return request({
    url: '/api/vingsoft-ywsp/proCaseInfo/getCaseInfoByProjectNo',
    method: 'post',
    params: {
      projectNo
    }
  })
};



export const getDeletedPageList = (current, size, params) => {
  return request({
    url: '/api/vingsoft-ywsp/proCaseInfo/getDeletedPageList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
};



export const removeByProjectList = (projectNos) => {
  return request({
    url: '/api/vingsoft-ywsp/proCaseInfo/removeByProjectList',
    method: 'post',
    params: {
      projectNos
    }
  })
};



export const doneListUrl = (current, size, title) => {
  return request({
    url: '/api/vingsoft-ywsp/proCaseInfo/doneListUrl',
    method: 'get',
    params: {
      title,
      current,
      size,
    }
  })
};


export const ybHistoryList = (current, size, title) => {
  return request({
    url: '/api/vingsoft-ywsp/proCaseInfo/historyList',
    method: 'get',
    params: {
      title,
      current,
      size,
    }
  })
};
